#ifndef __SW_TIMER_H
#define __SW_TIMER_H

#include <stdio.h>
#include "main.h"

#define SW_TIMER_SIZE	48
#define SW_TIMER_TIME	10



typedef void(*sw_timer_callback)(void);

typedef struct 
{
	uint8_t run;
	uint16_t cnt;
	uint16_t time;
	sw_timer_callback callback;
}SW_TIMER_INFO;



void sw_timer_init(void);
void sw_timer_irq(void);
void sw_timer_loop(void);

uint8_t sw_timer_start(uint16_t ms, uint8_t flag, sw_timer_callback callback);
void sw_timer_update(uint8_t timer_id, uint16_t ms);
uint8_t sw_timer_stop(uint8_t timer_id);
void sw_timer_reset(uint8_t timer_id);
uint8_t sw_timer_is_valid(uint8_t timer_id);


#endif












